use std::fs;
use chrono;

fn copy_table() {
    let path_from = "./local/table.rs";
    let path_to = "./src/table.rs";
    let md_from = fs::metadata(path_from).unwrap();
    let md_to = fs::metadata(path_to).unwrap();
    if md_from.modified().unwrap() != md_to.modified().unwrap() {
        let text = fs::read_to_string(path_from).unwrap();
        fs::write(path_to, text).unwrap();
    }
}

fn main() {
    copy_table();
    let now = chrono::Local::now();
    let text = now.format("%Y%m%d%H%M").to_string();
    println!("cargo:rustc-env=SSLASH_VERSION={}", text);
}
